<meta charset="utf-8"/>
<link rel="stylesheet" href="style/calendrier.css" type="text/css" media="screen" />

<script type="text/javascript" src="modeles/jquery.js"></script>
<script type ="text/javascript" src="modeles/cachermontrer.js"></script>
<script type ="text/javascript" src="modeles/javascriptFonctions.js"></script>
<script type ="text/javascript" src="modeles/calendrier.js"></script>

<?php
	if(isset($_SESSION["message"]))
	{
		echo $_SESSION["message"];
		unset($_SESSION["message"]);
	}
	
	echo '<h2>Création d\'une Action de Communication</h2>
		  <form action="index.php?module=administration&amp;action=creerADC&amp;retour='.$_GET["retour"].'" method="POST">';
?>	<p>
		<label class="creation" for="TitreAction">Titre* : </label>
		<input class="obligatoire" type="text" name="TitreAction" onBlur="verifChamp(this)" onFocus="blanc(this)"/>
	</p>
	<p>
		<label class="creation" for="ThemeAction">Thème : </label>
		<select name="Theme" >
		<?php
			foreach($theme as $t)
			{
				echo	'
							<option value="'.$t->get_id().'">'.$t->get_libelle().'</option>
						';
			}
		?>
		</select>
	</p>
	<p>
		<label id="saction" for="Lie">Permettre la création de sous-actions : </label>
		<input id="sousAction" type="checkbox" name="Lie" value="1" onClick="cacher()" >
	</p>	
	<div id="cacher">
		<p>
			<label class="creation" for="NbEtudiants">Nombre d'étudiants* : </label>
			<input id="nbEtu" class="obligatoire" type="number" name="NbEtudiants" min="1" max=<?php echo '"'.ActionDeCommunication::getNbMaxEtuADC().'" onBlur="verifEtu(this,'.ActionDeCommunication::getNbMaxEtuADC().')"'?> onFocus="blancEtu()"/>
			<span id="erreurEtu"></span>	
		</p>	
		<p>
			<label class="creation" for="Enseignant">Enseignant : </label>
			<select name="Enseignant">
			<?php
				echo '<option value='.null.'> </option>';
				foreach($prof as $p)
				{
					if($p->get_login()!=" ")
					echo	'
								<option value="'.$p->get_login().'">'.$p->get_nom().' '.$p->get_prenom().'</option>
							';
				}
			?>
			</select>
		</p>	
		<p>
			<label class="creation" for="Date">Date de déroulement :</label>
			<input id="date" size=20 type="text" name="Date" placeholder="jj/mm/aaaa" class="calendrier"/>
			<span id="erreurDate"></span>
		</p>		
		<p>
			<label class="creation" for="DateLimite">Date limite d'inscription :</label>
			<input id="dateLimite" size=20 type="text" name="DateLimite" placeholder="jj/mm/aaaa" class="calendrier"/>
			<span id="erreurDateLimite"></span>
		</p>
		<p>
			<label class="creation" for="PointMaxA">Points max attribués : </label>
			<input id="nbPoint" type="number" name="PointMaxA" min="0" max=<?php echo  ActionDeCommunication::getNoteMax().' step="0.05" onBlur="verifPoint('.ActionDeCommunication::getNoteMax().')"'?> onFocus="blancPoint()"/>
			<span id="erreurPoint"></span>
		</p>
	</div>	
	<p>
		<label class="creation" for="Commentaire">Commentaire :</label>
		<textarea class="saisiecomment" name="Commentaire"  rows="8" cols="45"></textarea>
	</p>
	<p>
		<span id="erreur"></span>
	</p>
	<p>
		<input class="Ligne2" type='submit' value='Creer' name='CreerADC' onClick="return verifFormulaireCreation()"/>
		<input class="Ligne2" type='submit' value='Annuler' name='Annuler'/>		
	</p>
</form>